var express = require('express');
var router = express.Router();

const Products = require("../models/categoryModel.js");
const { showCategorys, getCategorys,addCategorys,updateCategorys,deleteCategorys } = require("../controllers/categoryproduct.js")

/* GET home page. */
//获取products集合并渲染
router.get('/showCategorys', showCategorys);

//新增
router.post('/',addCategorys)

//删除
router.delete('/',deleteCategorys)

//修改---获取id
router.get('/:_id', getCategorys);

//修改--点击确认修改
router.put('/',updateCategorys)

module.exports = router;

